<!DOCTYPE html>
<html lang="en">
<head>
	<title></title>
	<meta charset="UTF-8"/>
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap.min.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/bootstrap-responsive.min.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/uniform.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-style2.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/matrix-media.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/font-awesome/css/font-awesome.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<link rel="stylesheet" href="__PUBLIC__/Admin/css/changyun.css?v={#$Think.config.ADMIN_VERSION_VAL}"/>
	<style type="text/css">
		ul, li {
			list-style: none;
		}

		.control-group {
			font-size: 14px;
		}

		.control-group .controls label {
			display: inline-block;
		}

		.control-group .controls {
			margin-top: 5px;
		}

		.form-horizontal label {
			display: inline-block;
		}

		.am-g .am-switch {
			margin-top: 20px;
		}

		.upload_img_list {
			width: 100%;
			display: block;
		}

		.upload_img_list li {
			width: 80px;
			height: 80px;
			float: left;
			margin-right: 5px;
			margin-bottom: 10px;
		}

		.upload_img_list li img {
			width: 80px;
			height: 80px;
			border: 1px solid #cccccc;
			padding: 1px;
		}

		#J_imageView {
			padding-top: 5px;
		}

		#J_imageView li {
			width: 100px;
			height: 100px;
			float: left;
			margin-right: 15px;
			position: relative;
			margin-bottom: 10px;
		}

		#J_imageView li img {
			width: 100px;
			height: 100px;
			border: 1px solid #eeeeee;
			padding: 1px;
		}

		#J_imageView_1 {
			padding-top: 5px;
		}

		#J_imageView_1 li {
			width: 80px;
			height: 80px;
			float: left;
			margin-right: 15px;
			position: relative;
		}

		#J_imageView_1 li img {
			width: 80px;
			height: 80px;
			border: 1px solid #eeeeee;
			padding: 1px;
		}

		.del_pic {
			position: absolute;
			top: -5px;
			right: -5px;
			background-color: rgba(0, 0, 0, 0.5);
			color: #ffffff;
			width: 25px;
			height: 25px;
			border-radius: 50%;
			text-align: center;
			cursor: pointer;
		}

		.addBtn, .removeBtn {
			font-weight: bold;
			margin-right: 8px;
			width: 24px;
			display: inline-block;
			text-align: center;
		}

		.removeBtn {
			color: #d7342e;
		}

		#attrTable td {
			padding: 6px;
		}

		table.gridtable {
			font-family: verdana, arial, sans-serif;
			font-size: 11px;
			color: #333333;
			border-width: 1px;
			border-color: #cccccc;
			border-collapse: collapse;
		}

		table.gridtable th {
			border-width: 1px;
			padding: 8px;
			border-style: solid;
			border-color: #cccccc;
			background-color: #dedede;
		}

		table.gridtable td {
			border-width: 1px;
			padding: 8px;
			border-style: solid;
			border-color: #cccccc;
			background-color: #ffffff;
		}
	</style>
	<script>
	BASE_URL = 'http://menpiao.keansafe.com/';
	STORE_URL = '';
	UPLOAD_URL = "{#:U('Qiniu/adminPicture')}";
	</script>
</head>
<body>
<div id="content">
	<include file="Public/maintop"/>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">

				<div class="widget-box">
					<div class="cyz-m-tab">
						<ul class="cyz-m-tab-title">
							<li class="cyz-m-this" data-toggle="nav_tab" href="#tab1">文章详情</li>
						</ul>
					</div>
					<div class="widget-content">
						<form action="{#$this_url_action}" method="post" class="form-horizontal" id="form_basic_validate" enctype="multipart/form-data">
							<div id="tab1" class="tab-pane active">
								<div class="widget-content nopadding">
									<div class="control-group">
										<label class="control-label">文章分类 :</label>
										<div class="controls">
											{#$info.cate_name}
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">文章标题 :</label>
										<div class="controls">
											{#$info.title}
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">缩略图 :</label>
										<div class="controls">
											<div class="upload_img_list" id="lit_pic_one_data">
												<li><img src="{#$info.lit_pic}"/></li>
											</div>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">文章类型 :</label>
										<div class="controls">
											<if condition="$info.content_type ==1">
												<span class="btn btn-mini btn-success">内容</span><br/><br/>
												<volist name="info.content" id="content_info">
													<eq name="content_info.type" value="image">
														<div class="upload_img_list">
															<a href="{#$content_info.content}" target="_blank">
																<li><img src="{#$content_info.content}"/></li>
															</a>
														</div>
													</eq>
													<eq name="content_info.type" value="video">
														<div class="upload_img_list">
															<a href="{#$content_info.content}" target="_blank">
																<video src="{#$content_info.content}" style="width: 100px;"></video>
															</a></div>
													</eq>
													<eq name="content_info.type" value="text">
														{#$content_info.content}
													</eq>
												</volist>
											</if>
											<if condition="$info.content_type ==2">
												<span class="btn btn-mini btn-warning">视频</span><br/><br/>
												<div class="upload_img_list">
													<a href="{#$info.video_url}" target="_blank">
														<video src="{#$info.video_url}" style="width: 100px;"></video>
													</a>
												</div>
											</if>
											<if condition="$info.content_type ==3">
												<span class="btn btn-mini btn-default">链接</span><br/><br/>
												<div class="upload_img_list">
													<a href="{#$info.link_url}" target="_blank">
														{#$info.link_url}
													</a>
												</div>
											</if>
											<if condition="$info.content_type ==4">
												<span class="btn btn-mini btn-primary">文件</span><br/><br/>
												<div class="upload_img_list">
													<a href="{#$content_info.file_url}" target="_blank">
														{#$info.file_url}
													</a>
												</div>
											</if>
										</div>
									</div>
									<div class="control-group">
										<label class="control-label">审核状态 :</label>
										<div class="controls">
											<label><input type="radio" name="article_status" value="0"
												<eq name="info.article_status" value="0">checked</eq>
												/>待审核</label>
											<label><input type="radio" name="article_status" value="1"
												<eq name="info.article_status" value="1">checked</eq>
												/>审核成功</label>
											<label><input type="radio" name="article_status" value="2"
												<eq name="info.article_status" value="2">checked</eq>
												/>审核失败</label>
										</div>
									</div>
								</div>
							</div>

							<div class="form-actions">
								<input type="hidden" name="id" value="{#$info.id|default=''}">
								<button type="submit" class="btn btn-success">保存</button>
							</div>
						</form>
					</div>
				</div>

			</div>
		</div>
		<hr>
	</div>
</div>
</div>
<textarea id="upload_editor" style="width: 0;height: 0;display: none;"></textarea>
<script src="__PUBLIC__/Admin/js/jquery.min.js"></script>
<script src="__PUBLIC__/Admin/js/jquery.ui.custom.js"></script>
<script src="__PUBLIC__/Admin/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/Admin/js/jquery.uniform.js"></script>
<script src="__PUBLIC__/Admin/js/matrix.js"></script>
<script src="__PUBLIC__/Admin/js/matrix.tables.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script src="__PUBLIC__/js/Validform.min.js"></script>
<script src="__PUBLIC__/js/laydate/laydate.js"></script>
<script src="__PUBLIC__/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="__PUBLIC__/ueditor/ueditor.all.min.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/ueditor/lang/zh-cn/zh-cn.js"></script>
<!--富文本编辑器开始-->
<script type="text/javascript">

var ue = UE.getEditor('container', {
	initialFrameWidth: null,
	maximumWords: 999999,
	serverUrl: "{#:U('NewUpload/upload')}",
	zIndex: 100
});
var ue_uploader = UE.getEditor('upload_editor', {serverUrl: "{#:U('NewUpload/upload')}"});

function upOneImage(fname) {
	ue_uploader.ready(function() {
		var pickey = 1;
		ue_uploader.addListener('beforeInsertImage', function(t, arg) {
			if (pickey == 1) {
				$("#" + fname + "_one_data").html('<li><img src="' + arg[0].src + '" /></li>');
				$("#" + fname).val(arg[0].src);
			}
			pickey++;
		});
	});
	var myImage = ue_uploader.getDialog("insertimage");
	myImage.open();
}

function upMoreImage(fname) {
	ue_uploader.ready(function() {
		var pickey = 1;
		ue_uploader.addListener('beforeInsertImage', function(t, arg) {
			if (pickey == 1) {
				$.each(arg, function(i, data) {
					$("." + fname + "_imglist").append('<li><img src="' + data.src + '"><input type="hidden" name="x_img[]" value="' + data.src + '"><div class="del_pic"><i class="icon-remove"></i></div></li>');
				});
			}
			pickey++;
		});
	});
	var myImage = ue_uploader.getDialog("insertimage");
	myImage.open();
}
</script>
<!--图片上传结束-->
<!--富文本编辑器结束-->
<script type="text/javascript">
$(function() {
	$('input[type=checkbox],input[type=radio],input[type=file]').uniform();
	var loadi = null;
	var demo1 = $("#form_basic_validate").Validform({
		tiptype: 3,
		ajaxPost: true,
		postonce: true,
		tiptype: function(msg, o, cssctl) {
			if (!o.obj.is("form")) {
				var objtip = o.obj.siblings(".Validform_checktip");
				cssctl(objtip, o.type);
				objtip.text(msg);
			}
		},
		beforeSubmit: function(curform) {
			loadi = layer.load('表单正在处理中，请稍等 ...');
		},
		callback: function(data) {
			layer.close(loadi);
			if (data.status == 1) {
				layer.alert(data.msg, {icon: 1}, function() {
					window.location.href = "{#:U('index')}";
				});
			} else {
				layer.alert(data.msg, {icon: 0});
			}
		}
	});
})
</script>
</body>
</html>
